#include "ir.h"

#include "temp.h"

namespace Tree {

Exp::Exp() { } 

ExpList::ExpList(shared_ptr<Exp> head, shared_ptr<ExpList> tail) : head(head), tail(tail) { }

Const::Const(const int value) : Exp(), value(value) { }

Name::Name(shared_ptr<Temp::Label> label) : Exp(), label(label) { }

TempExp::TempExp(shared_ptr<Temp::Temp> temp) : Exp(), temp(temp) { }

Binop::Binop(BinaryOperation binop, shared_ptr<Exp> left, shared_ptr<Exp> right) : Exp(), binop(binop), left(left), right(right) { }

Mem::Mem(shared_ptr<Exp> exp) : Exp(), exp(exp) { }


Call::Call(shared_ptr<Exp> func, shared_ptr<ExpList> args) : Exp(), func(func), args(args) { }

ESeq::ESeq(shared_ptr<Stm> stm, shared_ptr<Exp> exp) : Exp(), stm(stm), exp(exp) { }


Stm::Stm() { }

StmList::StmList(shared_ptr<Stm> head, shared_ptr<StmList> tail) : head(head), tail(tail) { }

Move::Move(shared_ptr<Exp> dst, shared_ptr<Exp> src) : Stm(), dst(dst), src(src) { }

ExpStm::ExpStm(shared_ptr<Exp> exp) : Stm(), exp(exp) { }

Jump::Jump(shared_ptr<Exp> exp, shared_ptr<Temp::LabelList> targets) : Stm(), exp(exp), targets(targets) { }

CJump::CJump(CJumpOperation op, shared_ptr<Exp> left, shared_ptr<Exp> right, shared_ptr<Temp::Label> iftrue, shared_ptr<Temp::Label> iffalse) : Stm(), op(op), left(left), right(right), iftrue(iftrue), iffalse(iffalse) { }

Seq::Seq(shared_ptr<Stm> left, shared_ptr<Stm> right) : Stm(), left(left), right(right) { }

StmLabel::StmLabel(shared_ptr<Temp::Label> label) : Stm(), label(label) { }

}


